<?php
/**
 * CakePOWER
 * Package Routing.
 * 
 * @author:			Marco Pegoraro
 * @mail:			marco(dot)pegoraro(at)gmail(dot)com
 * 
 * 24 September 2009
 * This is the core routing for CakePHP.
 */



/**
 * Plugins Routing.
 * Each plugin can define a "/config/routes.php" file to define custo routes.
 * This file is optional.
 */
foreach ( DAC::read('sys.plugin') as $pluginName=>$plugin ) {
	
	// Compose the routes.php path and try to load it into system.                        #
	$tmp = DAC::read('sys.plugin.'.$pluginName.'.path').'config'.DS.'routes.php';
	if ( file_exists($tmp) ) require_once($tmp);
	
}

/**
 * Clean local variables.
 */
unset( $plugin );
unset( $pluginName );



/**
 * Global routes's ExtensionPoint.
 */
ExtensionManager::call('powerRoutes');

?>